package server.game.world;

import java.util.ArrayList;

import server.game.entity.character.npc.NPC;
import server.game.entity.character.player.Player;

public class World {

	private ArrayList<Player> players = new ArrayList<Player>();
	private ArrayList<NPC> npcs = new ArrayList<NPC>();
	
	public Player getPlayer(int index) {
		return players.get(index);
	}
	
	public NPC getNPC(int index) {
		return npcs.get(index);
	}
	
	public Player getPlayerByUsername(String username) {
		for(Player p : players) {
			if(p.getUsername().equals(username)) {
				return p;
			}
		}
		return null;
	}
	
	public ArrayList<Player> getPlayers() {
		return players;
	}

	public ArrayList<NPC> getNPCs() {
		return npcs;
	}	
}
